package com.superbytecode.stencil.service;

import com.superbytecode.stencil.repository.domain.TemplateGroup;
import com.superbytecode.stencil.repository.mapper.TemplateGroupMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Objects;

/**
 * All rights Reserved, Designed By www.super-master.com
 *
 * @ProjectName: code-stencil
 * @Package: com.superbytecode.stencil.service
 * @ClassName: GenTemplateService
 * @Description: []
 * <p> </p>
 * @Author: [Lance Ting]
 * @Date: 2024/10/11 22:18
 * @Version: V1.0
 * @Copyright: 2024 www.super-master.cn Inc. All rights reserved.
 * TODO: 注意,本文件Lance Ting所作,如果转载或使用请标明具体出处!
 **/
@Slf4j
@Service
public class TemplateGroupService {
    @Resource
    private TemplateGroupMapper templateGroupMapper;

    public TemplateGroup obtainTemplateGroup(Long groupId) {
        if (Objects.isNull(groupId)) {
            groupId = 1000L;
            // {
            //  "id": 1000,
            //  "groupName": "default",
            //  "projectName": "",
            //  "moduleName": "",
            //  "packageName": "com.superbytecode",
            //  "author": "Lance Ting",
            //  "email": "dingguoxin.pro@aliyun.com",
            //  "version": "v1.0",
            //  "copyright": "2024 www.super-bytecode.com Inc. All rights reserved.",
            //  "notes": "注意,本文件Lance Ting所作,如果转载或使用请标明具体出处!",
            //  "status": "1",
            //  "remark": ""
            //}
        }
        return templateGroupMapper.selectByPrimaryKey(groupId);
    }
}